<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!--JSTL core tag need to add jstl 1.2 jar to lib-->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head><title>Struts 2 Training Materials</title>
</head>

<body>
<c:set var="root" value="${pageContext.request.contextPath}"/>
<div align="center">
    <center>
        <table border="1" cellspacing="1" width="400">
            <tr>
                <td width="390"><font size="4"><b>Struts 2 Components and Work Flow</b></font></td>
            </tr>
            <tr>
                <td width="384">
                    <ul>
                        <li>
                            <a href="#">Components</a>
                            <br>
                            <b>web.xml :</b> Note in struts 2 we do not set the a servlet instead we use the struts 2 filter provided. Filter is used to do
                            some pre/post function before in passes to Servlet. Struts 2 filter implements the javax.servlet.Filter.
                            <br>
                            <br>
                            <b>The Controller : </b> Filter Dispatcher act as the controller in struts 2.
                            <br>
                            <b>struts.xml : </b> struts-config.xml has renamed to struts.xml that users to initialize the resources. In includes the Interceptors, Action Classes, Results.
                                                 Advantage over earlier version is you can define <b>One OR More </b> configuration files. But in runtime they all are put together.
                            <br>
                            <br>
                            <b>View : </b>The view in struts framework is mainly a jsp page which is responsible for producing the output to the user.
                            <br>
                            <b>Struts tag libraries : Details are in tag lib part.
                            <br>
                            <b>Resource file : Details are in resource file configurations.
                            <br>
                            <b>Business objects :  </b>It is the place where the rules of the actual project exists. These are the modules which just regulate the day- to- day site activities.
                            <br>
                            <b>The Response : </b> This is the output of the View JSP object.
                        </li>

                        <li>
                            <a href="#">Request Life Cycle</a>
                            <br>
                            <br>
                            <img src="../../images/processing.gif" border="0">
                            <br>
                            - User Sends request: User sends a request to the server for some resource.
                            <br>
                            - FilterDispatcher determines the appropriate action: The FilterDispatcher looks at the request and then determines the appropriate Action.
                            <br>
                            - Interceptors are applied - configured for applying the common functionality such as workflow, validation, file upload etc. are automatically applied to the request.
                            <br>
                            - Execution of Action: Then the action method is executed to perform the database related operations like storing or retrieving data from the database.
                            <br>
                            - Output rendering: Then the Result renders the output.
                            <br>
                            - Return of Request: Then the request returns through the interceptors in the reverse order. The returning request allows us to perform the clean-up or additional processing.
                            <br>
                            - Display the result to user: Finally the control is returned to the servlet container, which sends the output to the user browser.
                        </li>
                    </ul>
                </td>
            </tr>
            <tr>
                <td>
                    <a href="${root}/index.jsp">HOME</a>
                </td>
            </tr>
        </table>
    </center>
</div>
</body>
</html>